﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="maintenanceGalleryAdd.aspx.vb" Inherits="Web_2._0_BMW___X6_Experts_Web_Application.maintenanceGalleryAdd" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">

        .style3
        {
            font-size: x-large;
        }
        .style4
        {
            color: #3399FF;
        }
        .addNewImage
        {
            height: 379px;
        }
        .imageAdd
        {
            height: 215px;
        }
        .maintenanceAddImageListView
        {
            height: 1221px;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <span class="st"><span class="style3"><strong>BMW - X6 Add </strong>
        <span class="style4"><em><strong>Maintenance</strong></em></span><strong> Images</strong></span></span></p>

        <div class = "maintenanceImageAdd">
        
            Have you had any problems with your X6 which has costed you a lot of money, do 
            you not trust car repair centers??? If so then here is where you will find free 
            Maintenance help and guidance for your BMW - X6 from our registered users and 
            BMW experts.
    <br />
    <br />Why not get involved and upload a picture of a maintenance routine checkup to get 
            commented on. It can be anything based on maintenance from a unique screw to 
            changing a light bulb and repairing faults by yourself to save you money, It&#39;s 
            free and doesnt cost you a penny.<br />
    <br />
    
    <div class = "addNewImage">
    
    <div class = "addPhoto" 
            style="font-size: large; font-weight: bold; text-decoration: underline; font-style: italic;">
        
        Add a New Image</div>
    
    <div class = "insructionAddNewImage">
    
    
    
        To add an image to the gallery below, please follow these simple steps:</div>
    <div class = "step123">
    
    
    
        1. Browser and Locate your image file on your computer by clicking on the 
        browser button below, click on your file and press submit.<br />
        <br />
        2. Fill in the description of the image.<br />
        <br />
        3. Once you&#39;ve done this, simply click on &#39;Submit&#39; and your image will be 
        displayed on the thumbnail list below.</div> <br />

    <div class = "imageAddMaintenance">
    
        <table align="center" style="height: 208px; width: 487px">
                <tr>
                    <td align="left" class="style9" style="font-weight: bold" valign="middle">
                        Browser Picture</td>
                    <td class="style8">
                        <asp:FileUpload ID="fupimage" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td align="left" style="font-weight: bold" valign="top">
                        Description</td>
                    <td class="style4">
                        <asp:TextBox ID="txtimagedescription" runat="server" Font-Names="Calibri" 
                            ForeColor="Black" Height="66px" TextMode="MultiLine" Width="317px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="left" class="style5" colspan="2" style="font-weight: bold">
                        <asp:Button ID="btnsubmit" runat="server" Text="Submit" Width="125px" 
                            style="height: 26px" />
                        &nbsp;
                        <asp:Button ID="btnclear" runat="server" Text="Clear" Width="125px" />
                        <br />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ControlToValidate="fupimage" 
                            ErrorMessage="You have not selected an image, please check and try again." 
                            Font-Bold="True" Font-Italic="True" ForeColor="Red"></asp:RequiredFieldValidator>
                    </td>
                </tr>
            </table>
    
    </div>
    </div>

    <div class = "maintenanceAddImageListView">
    
        <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource2" 
            GroupItemCount="3">
            <AlternatingItemTemplate>
                <td runat="server" style="">
                   <a href="imageMaintenanceAddComments.aspx?id=<%# Eval("MaintenanceImageID") %>">
                        <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                    <br />
                    <strong>Description:</strong>
                    <asp:Label ID="ImageDescriptionLabel" runat="server" 
                        Text='<%# Eval("ImageDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel" runat="server" 
                        Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel" runat="server" 
                        Text='<%# Eval("TimeUploaded") %>' />
                    <br />
                    <strong>Uploaded by</strong>
                     <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                </td>
            </AlternatingItemTemplate>
            <EditItemTemplate>
                <td runat="server" style="">
                    <a href="imageMaintenanceAddComments.aspx?id=<%# Eval("MaintenanceImageID") %>">
                        <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                    <br />
                    <strong>Description:</strong>
                    <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                        Text='<%# Bind("ImageDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                        Text='<%# Bind("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                        Text='<%# Bind("TimeUploaded") %>' />
                    <br />
                    <strong>Uploaded by:</strong>
                     <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <br />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                    <br />
                </td>
            </EditItemTemplate>
            <EmptyDataTemplate>
                <table runat="server" style="">
                    <tr>
                        <td>
                            No data was returned.</td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <EmptyItemTemplate>
                <td runat="server" />
            </EmptyItemTemplate>
            <GroupTemplate>
                <tr ID="itemPlaceholderContainer" runat="server">
                    <td ID="itemPlaceholder" runat="server">
                    </td>
                </tr>
            </GroupTemplate>
            <InsertItemTemplate>
                <td runat="server" style="">
                   <a href="imageMaintenanceAddComments.aspx?id=<%# Eval("MaintenanceImageID") %>">
                        <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                    <strong>Description:</strong>
                    <asp:TextBox ID="ImageDescriptionTextBox" runat="server" 
                        Text='<%# Bind("ImageDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                        Text='<%# Bind("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:TextBox ID="TimeUploadedTextBox" runat="server" 
                        Text='<%# Bind("TimeUploaded") %>' />
                    <br />
                    <strong>Uploaded by:</strong>
                     <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <br />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                    <br />
                </td>
            </InsertItemTemplate>
            <ItemTemplate>
                <td runat="server" style="">
                   <a href="imageMaintenanceAddComments.aspx?id=<%# Eval("MaintenanceImageID") %>">
                        <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                    <br />
                    <strong>Description:</strong>
                    <asp:Label ID="ImageDescriptionLabel" runat="server" 
                        Text='<%# Eval("ImageDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel" runat="server" 
                        Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>Time Uploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel" runat="server" 
                        Text='<%# Eval("TimeUploaded") %>' />
                    <br />
                    <strong>Uploaded by:</strong>
                     <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                </td>
            </ItemTemplate>
            <LayoutTemplate>
                <table runat="server">
                    <tr runat="server">
                        <td runat="server">
                            <table ID="groupPlaceholderContainer" runat="server" border="0" style="">
                                <tr ID="groupPlaceholder" runat="server">
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr runat="server">
                        <td runat="server" style="">
                            <asp:DataPager ID="DataPager1" runat="server" PageSize="12">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
            <SelectedItemTemplate>
                <td runat="server" style="">
                    <a href="imageMaintenanceAddComments.aspx?id=<%# Eval("MaintenanceImageID") %>">
                        <asp:Image ID="Image1" runat="server" Height="200px" ImageUrl='<%# Eval("ImageLink") %>' Width="300px" /></a>
                    <br />
                    <strong>Description:</strong>
                    <asp:Label ID="ImageDescriptionLabel" runat="server" 
                        Text='<%# Eval("ImageDescription") %>' />
                    <br />
                    <strong>Date Uploaded:</strong>
                    <asp:Label ID="DateUploadedLabel" runat="server" 
                        Text='<%# Eval("DateUploaded") %>' />
                    <br />
                    <strong>TimeUploaded:</strong>
                    <asp:Label ID="TimeUploadedLabel" runat="server" 
                        Text='<%# Eval("TimeUploaded") %>' />
                    <br />
                    <strong>Uploaded by:</strong>
                     <a href="UserProfileView.aspx?Username=<%# Eval("UserName") %>"><asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' /></a>
                    <br />
                </td>
            </SelectedItemTemplate>
        </asp:ListView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            
            SelectCommand="SELECT Maintenance_Images.MaintenanceImageID, Maintenance_Images.ImageLink, Maintenance_Images.ImageDescription, Maintenance_Images.DateUploaded, Maintenance_Images.TimeUploaded, aspnet_Users.UserName FROM (Maintenance_Images INNER JOIN aspnet_Users ON Maintenance_Images.UserIDFK = aspnet_Users.UserId) ORDER BY Maintenance_Images.MaintenanceImageID DESC">
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>
    
    </div>

    
    

        </div>
        
        
</asp:Content>
